import sys

nums = [1, 3, 5, 6]
target = 2

if target < nums[0]:
    print(0)
    sys.exit(0)
for i in range(len(nums)):
    if target == nums[i]:
        print(i)
        sys.exit(0)
    if target > nums[i]:
        if i + 2 > len(nums):
            print(i + 1)
            sys.exit(0)
        if target < nums[i + 1]:
            print(i + 1)
            sys.exit(0)
